<script setup>
import { ref } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { useStore } from 'vuex';

const router = useRouter();
const store = useStore();

// 影院列表
store.dispatch('hot/updateCinemaList');
const cinemaList = computed(() => store.state.hot.cinemaList);
</script>

<template>
  <div class="cinema-header">
    <span class="cinema-city">广州</span>
    <span class="cinema-name">影院</span>
    <div class="search"><i-ep-Search class="sear" /></div>
  </div>
  <div class="cinema-content">
    <div
      class="cinema-item"
      v-for="item in cinemaList"
      :key="item.cinema_id"
    >
      <h3>{{ item.cinema_name }}</h3>
      <div class="address">{{ item.specified_address }}</div>
      <div class="lable">
        <span>小吃</span>
        <span>4D厅</span>
        <span>巨幕厅</span>
        <span>杜比全景声厅</span>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scope>
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #fff;
}
.cinema-header {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  background-color: #dd2727;
  display: flex;
  justify-content: space-around;
  align-items: center;
  .cinema-city {
    color: #fff;
    font-size: 16px;
  }
  .cinema-name {
    display: inline-block;
    color: #fff;
    width: 64px;
    font-size: 16px;
    text-align: center;
    margin: 0 20px;
  }
  .search {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    .sear {
      font-size: 20px;
      color: #fff;
    }
  }
}
.cinema-content {
  width: 100%;
  height: calc(100% - 50px);
  background-color: #fff;
  box-sizing: border-box;
  .cinema-item {
    width: 100%;
    height: 120px;
    background-color: #fff;
    box-sizing: border-box;
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    h3 {
      width: 100%;
      height: 30px;
      line-height: 30px;
      margin: 0;
      font-size: 16px;
      color: #333;
    }
    .address {
      width: 100%;
      height: 30px;
      font-size: 12px;
      line-height: 30px;
      background-color: #fff;
      overflow: hidden;
      -webkit-line-clamp: 1;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      word-break: break-all;
      line-break: anywhere;
    }
    .lable {
      width: 100%;
      height: 30px;
      background-color: #fff;
      display: flex;
      align-items: center;
      span {
        padding: 0 8px;
        margin-right: 4px;
        border: 1px solid #ff9a00;
        border-radius: 4px;
        text-align: center;
        line-height: 24px;
        font-size: 8px;
        color: #ff9a00;
      }
    }
  }
}
</style>
